package org.kailu.book.entity;
// default package
// Generated May 24, 2014 1:38:24 PM by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * Customer generated by hbm2java
 */
@Entity
@Proxy(lazy=false)
@Table(name = "customer", catalog = "book")
public class CustomerEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer customerId;
	private String customerName;
	private long customerPhone;
	private String customerAddress;
	private Set<BillEntity> bills = new HashSet<BillEntity>(0);

	public CustomerEntity() {
	}

	public CustomerEntity(String customerName, long customerPhone,
			String customerAddress) {
		this.customerName = customerName;
		this.customerPhone = customerPhone;
		this.customerAddress = customerAddress;
	}

	public CustomerEntity(String customerName, long customerPhone,
			String customerAddress, Set<BillEntity> bills) {
		this.customerName = customerName;
		this.customerPhone = customerPhone;
		this.customerAddress = customerAddress;
		this.bills = bills;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "customer_id", unique = true, nullable = false)
	public Integer getCustomerId() {
		return this.customerId;
	}

	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	@Column(name = "customer_name", nullable = false, length = 50)
	public String getCustomerName() {
		return this.customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	@Column(name = "customer_phone", nullable = false)
	public long getCustomerPhone() {
		return this.customerPhone;
	}

	public void setCustomerPhone(long customerPhone) {
		this.customerPhone = customerPhone;
	}

	@Column(name = "customer_address", nullable = false, length = 50)
	public String getCustomerAddress() {
		return this.customerAddress;
	}

	public void setCustomerAddress(String customerAddress) {
		this.customerAddress = customerAddress;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	public Set<BillEntity> getBills() {
		return this.bills;
	}

	public void setBills(Set<BillEntity> bills) {
		this.bills = bills;
	}

}
